package com.oneraku.service.controller;

import com.oneraku.service.domain.AddressInfo;
import com.oneraku.service.domain.UserInfo;
import com.oneraku.service.dto.MargePassword;
import com.oneraku.service.dto.VerifyCode;
import com.oneraku.service.service.IAddressInfoService;
import com.oneraku.service.service.IUserInfoService;
import com.oneraku.service.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.xml.ws.soap.Addressing;

/**
 * @Author: hui.ren@huberbuy.com
 * @Date: 2020/2/26 11:25
 */
@RestController
@RequestMapping("/address")
public class AddressController {
    @Autowired
    private IAddressInfoService addressInfoService;
    /**
     * 列表 全部
     * @param addressInfo
     * @return
     */
    @PostMapping("/list")
    public R list(@RequestBody AddressInfo addressInfo) {
        return addressInfoService.listAddress(addressInfo);
    }
    /**
     * 编辑收货地址
     * @param addressInfo
     * @return
     */
    @PostMapping("/edit")
    public R edit(@RequestBody AddressInfo addressInfo) {
        return addressInfoService.editAddress(addressInfo);
    }
    /**
     * 删除收货地址
     * @param addressInfo
     * @return
     */
    @PostMapping("/del")
    public R del(@RequestBody AddressInfo addressInfo) {
        return addressInfoService.delAddress(addressInfo);
    }
    /**
     * 新增收货地址
     * @param addressInfo
     * @return
     */
    @PostMapping("/add")
    public R add(@RequestBody AddressInfo addressInfo) {
        return addressInfoService.addAddress(addressInfo);
    }
}
